<template>
	<!-- 单位概况 -->
	<view>
		<view>
			<view class="content" v-if="status">
				<view class="border_box" style="margin-top: 40rpx;">
					<fui-input class="field" label-class="font-color" :readonly="true" disabled v-model="list.workName"
						label="单位名称:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.address" 
						label="单位地址:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.unitDistrict"  
						label="所属区域:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.type"  
						:label-width="100" label="土地规划类型:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.name" 
						:label-width="120" label="安全负责人名字:" placeholder="" />
				</view>
				
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.mobile"  
						:label-width="120" maxlength="11" type="number" label="安全负责人联系方式:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.personInCharge" 
						:label-width="120" label="主要负责人:" placeholder="" />
				</view>
				
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.contactPersonInCharge"  
						:label-width="120" maxlength="11" type="number" label="主要负责人联系方式:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.aa"  :label-width="100"
						label="单位建筑面积:" placeholder="" />
				</view>
				<view class="bg_box">
					<view class="label">
						单位经营类型:
					</view>
					<view style="display: flex;flex-wrap: wrap;margin-left: 20rpx;margin-top: 10rpx;">
						<uni-data-checkbox style="width: 200rpx;" class="checkbox" v-model="list.checked"
							:localdata="sex"></uni-data-checkbox>
					</view>
				</view>
				<view >
					<van-button class="btn80" @click="submit()">提交</van-button>
				</view>
				<!-- <view v-if="user.power == 1">
					<van-button class="btn80" @click="submit()">提交</van-button>
				</view>
				
				<view v-if="user.power == 2">
					<van-button class="btn80" @click="submit()">提交</van-button>
				</view> -->
				
			</view>
			<view class="content" v-if="!status">
				<view class="border_box" style="margin-top: 40rpx;">
					<fui-input label-class="font-color" class="field" v-model="list.workName" disabled label="单位名称:"
						:readonly="true" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.address" disabled :readonly="true"
						label="单位地址:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.unitDistrict" disabled
						:readonly="true" label="所属区域:" placeholder="" />
				</view>

				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.type" disabled :readonly="true"
						:label-width="100" label="土地规划类型:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.name" disabled :readonly="true"
						:label-width="120" label="安全负责人名字:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.mobile" disabled :readonly="true"
						:label-width="120" label="安全负责人联系方式:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.personInCharge" disabled :readonly="true"
						:label-width="120" label="主要负责人:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.contactPersonInCharge" disabled :readonly="true"
						:label-width="120" label="主要负责人联系方式:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.aa" disabled :readonly="true"
						:label-width="100" label="单位建筑面积:" placeholder="" />
				</view>
				<view class="border_box">
					<fui-input class="field" label-class="font-color" v-model="list.userExpirationTime" disabled
						:readonly="true" :label-width="100" label="帐户到期时间:" placeholder="" />
				</view>
				<view class="bg_box">
					<view class="label">
						单位经营类型:
					</view>
					<view style="display: flex;flex-wrap: wrap;margin-left: 20rpx;margin-top: 10rpx;">
						<uni-data-checkbox style="width: 200rpx;" class="checkbox" v-model="list.checked"
							:localdata="sex" disabled></uni-data-checkbox>
					</view>
				</view>

				<view v-if="user.power == 1 || user.power == 2">
					<van-button class="btn80" @click="status=!status">修改</van-button>
				</view>
				
				<view v-if="user.power == 3">
					<van-button class="btn80" @click="status=!status">修改</van-button>
				</view>
			</view>
		</view>
		
		<view>
			<u-picker title="请选择时间分类" @confirm="onUniTime" @cancel="showUniTime = !showUniTime" :show="showUniTime"
				:columns="uniTimecolumns"></u-picker>
		</view>
	</view>
</template>

<script>
	import {
		BASE_IP
	} from '@/common/http/url.js'
	export default {
		data() {
			return {
				defaultValue: '',
				checked1: false,
				checked2: false,
				checked3: false,
				checked4: false,
				checked5: false,
				checked6: false,
				checked7: false,
				checked8: false,
				checked9: false,
				checked11: false,
				checked12: false,
				checked13: false,
				sex: [{
						text: '甲乙类厂房',
						value: '甲乙类厂房'
					},
					{
						text: '丙类厂房',
						value: '丙类厂房'
					},
					{
						text: '丁戊类厂房',
						value: '丁戊类厂房'
					},
					{
						text: '甲乙类仓库',
						value: '甲乙类仓库'
					},
					{
						text: '丙类仓库',
						value: '丙类仓库'
					},
					{
						text: '丁戊类仓库',
						value: '丁戊类仓库'
					},
					{
						text: '办公',
						value: '办公'
					},
					{
						text: '普通商业',
						value: '普通商业'
					},
					{
						text: '娱乐类商业',
						value: '娱乐类商业'
					},
					{
						text: '体育场馆',
						value: '体育场馆'
					},
					{
						text: '餐饮就业',
						value: '餐饮就业'
					},
					{
						text: '酒店商业',
						value: '酒店商业'
					},
					{
						text: '公寓商业',
						value: '公寓商业'
					},
				],
				status: true,
				list: {
					workName: '',
					address: '',
					type: '',
					name: '',
					mobile: '',
					area: '',
					aa: '',
					checked: '',
					id: '',
					userExpirationTime: "",
					unitDistrict: "",
					personInCharge : "",
					contactPersonInCharge : ""
				},
				active: 0,
				vTabs: false,
				value1: 0,
				flag: false,
				tabs: ['消防记录概况', '消防单位概况'],
				index: 0,
				chartData: {},
				//您可以通过修改 config-ucharts.js 文件中下标为 ['area'] 的节点来配置全局默认参数，如都是默认参数，此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式，达到页面简洁的需求。
				opts: {
					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
						"#ea7ccc"
					],
					padding: [15, 10, 0, 15],
					enableScroll: false,
					legend: {},
					xAxis: {
						disableGrid: true
					},
					yAxis: {
						gridType: "dash",
						dashLength: 2
					},
					extra: {
						line: {
							type: "straight",
							width: 2,
							activeType: "hollow"
						}
					}
				},
				recordopslist: [{
						id: 0,
						name: "防火检查记录概况"
					},
					{
						id: 1,
						name: "防火巡查记录概况"
					},
					{
						id: 2,
						name: "消防栓制室值班记录"
					}
				],
				user: "",
				units: "",
				list1: [{
					name: '单位',
				}, {
					name: '区域',
				}, {
					name: '经营类型',
				}, {
					name: '维保合同',
				}],
				list2: [{
					name: '单位',
				}, {
					name: '区域',
				}, {
					name: '经营类型',
				}],
				list3: [{
					name: "每日防火巡查记录表"
				}, {
					name: "灭火器安全检查记录表"
				}, {
					name: "消防控制室值班记录表"
				}, {
					name: "消防栓检查表"
				}, {
					name: "建筑消防设施维护保养和故障维修记录表"
				}, {
					name: "专职、义务消防队人员记录表"
				}, {
					name: "灭火和应急疏散预案演练记录表"
				}, {
					name: "年度消防经费开支统计记录表"
				}, {
					name: "动用明火记录表"
				}, {
					name: "消防监控室制表记录表"
				}, {
					name: "消防安全宣传培训记录表"
				}, {
					name: "消防检查整改记录表"
				}, {
					name: "消防设施管理表"
				}, {
					name: "消防安全日查记录表"
				}, {
					name: "消防定期检查记录表"
				}, {
					name: "消防测试记录表"
				}],
				recordIndex: 0,
				showUniTime: false,
				uniTimecolumns: [
					['全部', '30天', '60天', '90天']
				],
				title: "时间分类：",
				unitTitle: "全部",
				unitsSortdata: [],
				day: 0,
				preset: ""
			}
		},

		onLoad() {
			let user = uni.getStorageSync("user")
			 
			this.user = user
			console.log(user)
			this.queryUnit()
			let _this = this

		},
		onHide() {
			// this.queryUnit()
			// this.getUnit()
			// this.getPrall()

		},
		onShow() {
			// this.queryUnit()
			// this.getUnit()
			// this.getPrall()
		},
		methods: {
			toTest() {
				uni.navigateTo({
					url: "/pages/test/test"
				})
			},
			appVersion() {
				// console.log("11111111")
				const systemInfo = uni.getSystemInfoSync();
				let v = systemInfo.appWgtVersion

				let url = BASE_IP + "pc/iotFireAlarmRecord/version"


				uni.request({
					header: {
						"Authorization": this.user.token,
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					url: url,
					method: "GET",
					success: (res) => {

						if (res.statusCode == 200) {
							console.log("请求的数据", res.data)
							if (res.data === v) {
								console.log("最新版")
							} else {
								uni.showModal({
									showCancel: false,
									title: "新版本",
									content: "该APP不是最新版本，请前往：用户中心-关于应用-点击连接下载最新版本"
								})
								console.log("不是最新版")
							}
						}

					},
					fail: () => {

					}
				})

				// console.log("==========>", v)
			},
			initCid() {
				
			},
			judgeIosPermissionPush() {
				if (uni.getSystemInfoSync().platform == 'ios') { //ios
					var result = false;
					var UIApplication = plus.ios.import("UIApplication");
					var app = UIApplication.sharedApplication();
					var enabledTypes = 0;
					if (app.currentUserNotificationSettings) {
						var settings = app.currentUserNotificationSettings();
						enabledTypes = settings.plusGetAttribute("types");
						// console.log("enabledTypes1:" + enabledTypes);
						if (enabledTypes == 0) {
							// gotoAppPermissionSetting()
							console.log("推送权限没有开启");
						} else {
							result = true;
							// console.log("已经开启推送功能!")
						}
						plus.ios.deleteObject(settings);
					} else {
						enabledTypes = app.enabledRemoteNotificationTypes();
						if (enabledTypes == 0) {
							// gotoAppPermissionSetting()
							console.log("推送权限没有开启!");
						} else {
							result = true;
							console.log("已经开启推送功能!")
						}
						console.log("enabledTypes2:" + enabledTypes);
					}
					plus.ios.deleteObject(app);
					plus.ios.deleteObject(UIApplication);
					return result;
				} else { //android
					var result = false
					var main = plus.android.runtimeMainActivity();
					var pkName = main.getPackageName();
					var uid = main.getApplicationInfo().plusGetAttribute("uid");
					var NotificationManagerCompat = plus.android.importClass("androidx.core.app.NotificationManagerCompat")
					//("android.support.v4.app.NotificationManagerCompat");
					var areNotificationsEnabled = NotificationManagerCompat.from(main)
					// 未开通‘允许通知’权限，则弹窗提醒开通，并点击确认后，跳转到系统设置页面进行设置  
					if (!areNotificationsEnabled.areNotificationsEnabled()) {
						uni.showModal({
							title: '提示',
							content: '请先打开APP通知权限',
							showCancel: false,
							success: function(res) {
								if (res.confirm) {
									var Intent = plus.android.importClass('android.content.Intent');
									var Build = plus.android.importClass("android.os.Build");
									//android 8.0引导  
									if (Build.VERSION.SDK_INT >= 26) {
										var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS');
										intent.putExtra('android.provider.extra.APP_PACKAGE', pkName);
									} else if (Build.VERSION.SDK_INT >= 21) { //android 5.0-7.0  
										var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS');
										intent.putExtra("app_package", pkName);
										intent.putExtra("app_uid", uid);
									} else { //(<21)其他--跳转到该应用管理的详情页
										var Settings = plus.android.importClass("android.provider.Settings");
										var Uri = plus.android.importClass("android.net.Uri");
										var intent = new Intent();
										intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
										var uri = Uri.fromParts("package", main.getPackageName(), null);
										intent.setData(uri);
									}
									// 跳转到该应用的系统通知设置页  
									main.startActivity(intent);
									return result
								}
							}
						});
					} else {
						result = true
						return result
					}
				}
			},
			initPresetFeatureSettin() {
				let user = uni.getStorageSync("user")
				let url = BASE_IP + "pc/presetFeatureSettin/" + user.unitId
				// console.log(url)
				uni.request({
					header: {
						"Authorization": user.token
					},
					url: url,
					success: (res) => {
						// console.log(res)
						uni.setStorageSync("recordTable", res.data)

					},
					fail: (res) => {
						uni.showToast({
							title: "服务器请求失败",
							icon: "error"
						})
						return
					}
				})
			},
			getPrall() { //获取预设功能对象数据
				// console.log("调用111111111111111111111111111")
				let user = uni.getStorageSync("user")
				// console.log(user)
				// this.user = user
				let url = BASE_IP + "pc/presetfunction/find/presetFunction/" + user.unitId
				uni.request({
					header: {
						"Authorization": user.token,
					},
					url: url,
					success: (res) => {
						// console.log("请求成功：",res)
						// uni.removeStorageSync("pralldata")
						uni.setStorageSync("pralldata", res.data)
						// console.log("pralldata", res.data)
					},
					fail: (res) => {
						// console.log("请求失败：", res)
					}
				})
			},
			queryUnit() {
				let user = uni.getStorageSync("user")
				// console.log("用户对象：",user)
				let url = BASE_IP + "pc/unit/query/" + user.userName
				uni.request({
					url: url,
					header: {
						"Authorization": user.token
					},
					success: (res) => {
						if (res.statusCode == 200 && res.data != '') {
							console.log(res.data)
							this.list.name = res.data.safetyName
							this.list.type = res.data.landPlanningType
							this.list.mobile = res.data.safetyPhone
							this.list.workName = res.data.unitName
							this.list.address = res.data.unitAddress
							this.list.aa = res.data.unitArea
							this.list.id = res.data.unitID
							this.list.checked = res.data.unitType
							this.list.userExpirationTime = user.userExpirationTime
							this.list.unitDistrict = res.data.unitDistrict
							this.list.personInCharge = res.data.personInCharge
							this.list.contactPersonInCharge = res.data.contactPersonInCharge
							this.status = false
							let title = res.data.unitDistrict + "消防重点单位智能管理系统"
							uni.setStorageSync("unit", this.list)
							// console.log("消防单位对象：", title)
							uni.setNavigationBarTitle({
								title: "消防单位概况"
							})
						}

						// console.log("获取单位对象：",res)
					},
					fail: () => {
						uni.showToast({
							title: "服务器出现问题",
							icon: "error"
						})
					}
				})

			},
			submit() {
				let user = uni.getStorageSync('user')
				if (this.list.workName === "" || this.list.address === "" || this.list.type === "" || this.list
					.name ===
					"" || this.list.mobile === "" || this.list.aa === "" || this.list.checked === "") {
					uni.showToast({
						title: '需填写完整',
						icon: 'none',
						duration: 2000
					})

				} else if (this.list.id == '' || this.list.id == null) {
					// const store = useLoginStore()
					// console.log(this.list.checked)

					var Name = user.userName
					let mlist = {
						unitName: this.list.workName,
						unitAddress: this.list.address,
						unitAbbreviation:"",
						unitDistrict :  this.list.unitDistrict ,
						landPlanningType: this.list.type,
						safetyName: this.list.name,
						safetyPhone: this.list.mobile,
						unitType: this.list.checked,
						unitArea: this.list.aa,
						userName: Name,
						personInCharge : this.list.personInCharge,
						contactPersonInCharge : this.list.contactPersonInCharge
					}
					
					console.log(mlist)
					
					
					// console.log("传的数据：", mlist)
					let url = BASE_IP + "pc/unit/insert"
					let _this = this
					uni.request({
						url: url,
						header: {
							"Authorization": user.token
						},
						data: mlist,
						method: "POST",
						success: (res) => {
							if (res.statusCode == 200) {
								uni.showToast({
									title: "提交成功",
									icon: "success"
								})
								// _this.status = false
								this.queryUnit()
								return
							}
						},
						fail: () => {
							uni.showToast({
								title: "提交失败",
								icon: "error"
							})
							return
						}
					})

				} else if (this.list.id != null || this.list.id != '') {
					let ulist = {
						unitName: this.list.workName,
						unitAddress: this.list.address,
						unitAbbreviation: "",
						unitDistrict :  this.list.unitDistrict ,
						landPlanningType: this.list.type,
						safetyName: this.list.name,
						safetyPhone: this.list.mobile,
						unitType: this.list.checked,
						unitArea: this.list.aa,
						userName: Name,
						unitID: this.list.id,
						personInCharge : this.list.personInCharge,
						contactPersonInCharge : this.list.contactPersonInCharge
					}
					if(ulist.personInCharge === ulist.safetyName){
						uni.showModal({
							title:"提示",
							content:"安全负责人和主要负责人不能为同一个人！",
							showCancel:false
						})
						return
					}
					console.log(ulist)

					let url = BASE_IP + "pc/unit/update"
					uni.request({
						url: url,
						header: {
							"Authorization": user.token
						},
						data: ulist,
						method: "POST",
						success: (res) => {
							if (res.statusCode == 200) {
								uni.showToast({
									title: "修改成功",
									icon: "success"
								})
								// _this.status = false
								
								this.queryUnit()
								
								return
							}
						},
						fail: () => {
							uni.showToast({
								title: "修改失败",
								icon: "error"
							})
							return
						}
					})
				}
				this.status = false
			},
			
			getworkName(res) {
				// console.log(res)
				this.list.workName = res.detail.value
			},
			getaddress(res) {
				// console.log(res)
				this.list.address = res.detail.value
			},
			getDistrict() {
				this.list.unitDistrict = res.detail.value
			},
			gettype(res) {
				this.list.type = res.detail.value
			},
			getname(res) {
				this.list.name = res.detail.value
			},
			getmobile(res) {
				// console.log(res)
				this.list.mobile = res.detail.value
			},
			getaa(res) {
				// console.log(res)
				this.list.aa = res.detail.value
			},
			onClickTab(res) {
				this.active = res.name
				// console.log(res)
			},
			change(res) {
				// console.log(res)
				this.index = res.index
			},
			getServerData() {
				//模拟从服务器获取数据时的延时
				setTimeout(() => {
					//模拟服务器返回数据，如果数据格式和标准格式不同，需自行按下面的格式拼接
					let url = BASE_IP + "pc/iotFireAlarmRecord/query/" + this.user.unitId
					uni.request({
						header: {
							"Authorization": this.user.token
						},
						url: url,
						success: (res) => {
							// console.log(res)
							uni.setStorageSync("chart", res.data)
						}
					})
					let charts = uni.getStorageSync("chart")

					let res = {
						categories: [],
						series: []
					};
					let temp = {
						name: "感烟火灾探测器",
						data: [],
						color: ""
					}

					let temp1 = {
						name: "复合火灾探测器",
						data: [],
						color: ""
					}
					let temp2 = {
						name: "火警",
						data: [],
						color: ""
					}
					let temp3 = {
						name: "火警错报",
						data: [],
						color: ""
					}
					let temp4 = {
						name: "故障报警",
						data: [],
						color: ""
					}
					let temp5 = {
						name: "监管报警",
						data: [],
						color: ""
					}

					let categories = []
					// console.log(charts)
					for (let index in charts) {
						// console.log(charts[index])

						// if (charts[index].smokeFireDetector >= 60) {
						// 	temp.color = "#EE6666"
						// }

						temp.data.push(charts[index].smokeFireDetector)

						// if (charts[index].compositeFireDetector >= 60) {
						// 	temp1.color = "#EE6666"
						// }

						temp1.data.push(charts[index].compositeFireDetector)

						temp2.data.push(charts[index].fireAlarm)
						temp3.data.push(charts[index].fireAlarmFalseAlarm)
						temp4.data.push(charts[index].malfunction)
						temp5.data.push(charts[index].supervisionAlarm)

						res.categories.push(charts[index].date)
					}
					res.series.push(temp)
					res.series.push(temp1)
					res.series.push(temp2)
					res.series.push(temp3)
					res.series.push(temp4)
					res.series.push(temp5)
					let obj = {
						temp: temp,
						temp1: temp1,
						temp2: temp2,
						temp3: temp3,
						temp4: temp4,
						temp5: temp5,
					}

					uni.setStorageSync("chartson", obj)
					this.chartData = JSON.parse(JSON.stringify(res));
				}, 500);
			},
			toCharView(data) {
				// console.log(data)
				uni.navigateTo({
					url: "/pages/chartView/chartView?mid=" + data
				})
			},
			getUnit() {
				if (this.user.power == 2) {
					let user = uni.getStorageSync("user")
					let url = BASE_IP + "pc/group/queryGroup/" + user.uuid
					uni.request({
						header: {
							"Authorization": user.token
						},
						method: "GET",
						url: url,
						success: (res) => {
							if (res.statusCode == 200) {
								// console.log(res)
								uni.setStorageSync("units", res.data)
							}
						}
					})
					let units = uni.getStorageSync("units");
					console.log(units)
					this.units = units;
				}
				if (this.user.power == 1) {
					let user = uni.getStorageSync("user")
					let url = BASE_IP + "pc/unit/getAll"
					uni.request({
						header: {
							"Authorization": user.token
						},
						method: "GET",
						url: url,
						success: (res) => {
							if (res.statusCode == 200) {
								// console.log(res)
								uni.setStorageSync("units", res.data)
							}
						}
					})
					let units = uni.getStorageSync("units");
					// console.log(units)
					this.units = units;
				}

				// console.log("获取所有单位", units)
			},
			toUnits(item) {
				uni.navigateTo({
					url: "/pages/chartView/unitCharView?unit=" + JSON.stringify(item)
				})
			},
			onRecord(res) {
				// console.log(res)
				this.recordIndex = res.index
			},
			onUniTime(res) {
				let day = 0
				if (res.indexs == 0) {
					this.unitTitle = "全部"
					day = 0
					this.unitsSort(day)
				}
				if (res.indexs == 1) {
					this.unitTitle = "30天"
					day = 30
					this.unitsSort(day)
				}
				if (res.indexs == 2) {
					this.unitTitle = "60天"
					day = 60
					this.unitsSort(day)
				}
				if (res.indexs == 3) {
					this.unitTitle = "90天"
					day = 90
					this.unitsSort(day)
				}
				this.showUniTime = false
			},
			unitsSort(day) {
				let data = this.units;
				const today = new Date().setHours(0, 0, 0, 0); // 获取当前日期的时间戳，忽略时间部分
				data.forEach(obj => {
					if (obj.fireMaintenanceExpirationTime) {
						const expirationTime = new Date(obj.fireMaintenanceExpirationTime).setHours(0, 0, 0,
							0); // 获取过期日期的时间戳，忽略时间部分
						const daysDifference = Math.floor((expirationTime - today) / (24 * 60 * 60 *
							1000)); // 计算天数差
						obj.daysSinceToday = daysDifference;
					} else {
						obj.daysSinceToday = 0;
					}
				});

				if (day === 0) {
					data.sort((a, b) => new Date(a.fireMaintenanceExpirationTime) - new Date(b
						.fireMaintenanceExpirationTime));
				} else {
					data = data.filter(obj => obj.daysSinceToday <= day);
					data.sort((a, b) => a.daysSinceToday - b.daysSinceToday);
				}

				this.unitsSortdata = data;
			},
			getUserReminder() {
				let user = uni.getStorageSync("user")
				// console.log(user)
				let url = BASE_IP + "pc/classification/query/" + user.uuid
				let _this = this
				uni.request({
					url: url,
					header: {
						"Authorization": user.token
					},
					success: (res) => {
						// console.log(res)
						uni.setStorageSync("reminder", res.data)
					}
				})
			}
		},
		created() {

		},
		mounted() {

		},
		onNavigationBarButtonTap() {
			uni.navigateTo({
				url: "/pagesMine/notificationCenter/notice/notice"
			})
		}
	}
</script>

<style lang="scss" scoped>
	@import "../../static/font_4345741_sh6hb2nmgxi/iconfont.css";

	body {
		background-color: rgb(247, 247, 247);
	}

	.border_box {
		border-bottom: 2px solid #eeeeee;
		width: 95%;
		margin: auto;
		margin-top: 20rpx;

	}

	.field {
		border-radius: 15rpx;
	}

	.bg_box {
		background-color: white;
		border-radius: 15rpx;
		border-bottom: 2px solid #eeeeee;
		margin: auto;
		margin-top: 20rpx;
		width: 95%;
		padding-top: 20rpx;
		padding-bottom: 20rpx;
	}

	.label {
		margin-left: 30rpx;
		font-size: 28rpx;

	}

	.checkbox {
		margin-top: 10rpx;
		/* margin-right: 20rpx; */
		font-size: 28rpx;
		width: 10rpx;
	}

	.btn80 {
		background-color: #49A0FF;
		color: white;
		width: 80%;
		margin-left: 80rpx;
		margin-top: 50rpx;
		border-radius: 50rpx;
	}

	:deep(.uni-label-pointer) {
		width: 180rpx;
	}

	:deep(.checklist-box) {
		width: 25%;
	}

	:deep(.checklist-text) {
		width: 160rpx;
	}

	:deep(.font-color) {
		color: #303133;
	}

	.fui-grid__cell {
		width: 150rpx;
		height: 150rpx;
		text-align: center;
		margin: 20rpx auto;
		font-size: 8px;
		color: #303133;
	}

	.record-son {
		width: 90%;
		height: 100%;
		margin: 20rpx auto;
	}

	.routine-text {
		display: flex;
		align-items: center;
	}
</style>